package com.wclass.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 优惠券管理
 * </p>
 *
 * @author SEN
 * @since 2019-02-25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("base_discount")
public class BaseDiscount extends SuperEntity<BaseDiscount> {

    private static final long serialVersionUID = 1L;

    /**
     * 课程id
     */
    @TableField("course_id")
    private Long courseId;

    @TableField(exist = false)
    private String couresName;
    /**
     * 状态 0 正在推广 1 推广过期
     */
    private Integer state;
    /**
     * 数量
     */
    private Integer number;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField("start_time")
    private Date startTime;
    /**
     * 到期时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField("expire_time")
    private Date expireTime;
    /**
     * 优惠金额
     */
    private Long amount;
    /**
     * 发布人id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 数量(已被领取数量)
     */
    @TableField("number_draw")
    private Integer numberDraw;
    /**
     * 使用数量
     */
    @TableField(exist = false)
    private Integer useedNumber;

}
